package suites.stub {
	import org.splink.deepsplink.deeplink.IDeeplinkStrategy;

	/**
	 * @author Max Kugland
	 */
	public class DeeplinkStrategyStub implements IDeeplinkStrategy {
		private var _callback : Function;
		private var _adr : String = "";
		private var _running : Boolean = false;

		public function finalize() : void {
			_running = false;
		}

		public function start() : void {
			_running = true;
			gotoPage(_adr);
		}

		public function setCallback(callback : Function) : void {
			_callback = callback;
		}

		public function getCurrentAddress() : String {
			return _adr;
		}

		public function gotoPage(pageId : String) : void {
			_adr = pageId;
			if(_running && _callback != null) _callback();
		}
	}
}
